[19.0][FIX] website_product_configurator: make test suite green on 19.0#1
Open
cliffkujala wants to merge 6 commits into
Conversation
product.product_category_5 no longer exists in Odoo 19. Reference product.product_category_goods, which is always present (non-demo), so the test setup works with and without demo data.
- base.res_partner_1 no longer exists; create a partner in setUpClass. - test_remove_inactive_config_sessions passed a product.config.line id as product_tmpl_id, which violated the FK on Odoo 19; use a real product.template instead.
…olicy The discount_policy field was removed from product.pricelist; passing it on create raises ValueError on Odoo 19.
sale.order.line.product_uom was renamed to product_uom_id in Odoo 19.
sale.order._cart_update was removed in favour of _cart_add and _cart_update_line_quantity. Rewrite the test to exercise the module's overrides through the new API and assert the configuration session is preserved across quantity updates and that a zero quantity removes the line.
Port the website configurator tour to the Odoo 19 web_tour API so the HttpCase tours (test_01_admin_config_tour / test_02_demo_config_tour) run green: - Replace the removed trigger/extra_trigger style with the current single-trigger steps and modern run helpers. - Scope the dependent <select> steps with :has(option:contains(...)) so each step waits for its options to be rendered after the previous onchange RPC, instead of racing it (avoids the empty-value select error). - Mark the steps that navigate (search/select the product, and the final Continue) with expectUnloadPage: true. The final Continue submits the configuration (save_configuration, submit_configuration = true) and redirects via window.location from the RPC callback, so the unload fires asynchronously; keeping expectUnloadPage on the last step keeps allowUnload true and lets the tour finish on the configured product page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for the migration! I tested
website_product_configuratoron 19.0 and the module installs and works, but the test suite needed a few Odoo-19 API fixups to pass. These commits sit on top of your branch so they flow straight into PR OCA#176.All changes are test-only (no runtime module code is touched):
Summary
tests/common.py:product.product_category_5→product.product_category_goods(the old xmlid was removed in 19.0).tests/test_product_config.py/tests/test_sale_order.py: repair fixtures for 19.0 (partner xmlid, etc.).tests/test_sale_order.py: rewrite the cart assertions for the newsale.ordercart API (_cart_add/_cart_update_line_quantity), renameproduct_uom→product_uom_id, and drop the removed pricelistdiscount_policy.static/tests/tours/website_config_tour.esm.js: port the tour to the currentweb_tourAPI. Dependent<select>steps are scoped with:has(option:contains(...))so each waits for the previous onchange RPC to render its options, and the navigating steps (including the final Continue, which redirects viawindow.locationfrom the asyncsave_configurationcallback) are markedexpectUnloadPage: true.Test plan
test_01_admin_config_tourandtest_02_demo_config_tourpass under--test-enablewith demo data on 19.0.TransactionCasetests intests/pass.Feel free to cherry-pick or squash into your
[MIG]commit however you prefer.